package com.yanqu.road.entity.monopolymarket;

import com.alibaba.fastjson.JSON;
import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.monopolymarket.office.MonopolyMarketOfficeTip;

import java.util.ArrayList;
import java.util.List;

/**
 * 1 区服启动需要矫正数据
 *      a.分组发生改变 刷新体力 重置位置
 *      b.配置发生改变 刷新体力 重置位置
 *
 * @Description 榷场区服玩家数据
 * @Author cwq
 * @Data 2021/8/11 16:57
 */
@FieldTypeAnnotation(tableName = "t_u_monopolymarket_user_data")
public class MonopolyMarketUserData extends DataObject {
    @FieldTypeAnnotation(select = true, update = true)
    private long userId;
    @FieldTypeAnnotation(desc = "体力")
    private int physical;
    @FieldTypeAnnotation(desc = "上次恢复体力的时间(s)")
    private long physicalRefreshTime;
    @FieldTypeAnnotation(desc = "现在榷署所在的位置")
    private int officeCurPos = -1;
    @FieldTypeAnnotation(desc = "现在榷署所在的位置等级")
    private int officeLevel;
    @FieldTypeAnnotation(desc = "现在榷署所在的位置编号 1开始 加载校验用")
    private int officeNo;
    @FieldTypeAnnotation(desc = "入座榷署的时间")
    private int officeSeatTime;
    @FieldTypeAnnotation(desc = "今日抢夺榷署次数")
    private int officeRobTimes;
    @FieldTypeAnnotation(desc = "每日榷场刷新时间")
    private int dailyOfficeRefreshTime;
    @FieldTypeAnnotation(desc = "每日资源战派遣刷新时间")
    private int dailyResGrabRefreshTime;
    @FieldTypeAnnotation(desc = "是否有弹窗提示")
    private boolean hasTip;
    @FieldTypeAnnotation(desc = "当前可领取的待客茶数量")
    private int teaLastNum;
    @FieldTypeAnnotation(desc = "待客茶上次领取的时间（s） 策划说，入座的时候置为当前时间，不用管领取后的时间产出")
    private int teaLastGetTime;
    @FieldTypeAnnotation(desc = "最近一次进入榷署战报的时间  红点用")
    private int enterOfficeReportLastTime;
    @FieldTypeAnnotation(desc = "最近一次进入资源点战报的时间  红点用")
    private int enterResGrabReportLastTime;

    @FieldTypeAnnotation(desc = "榷署被抢的提示")
    private MonopolyMarketOfficeTip officeTip;
    @FieldTypeAnnotation(desc = "已领取的要塞奖励id")
    private List<Integer> receivedFortressId = new ArrayList<>();
    @FieldTypeAnnotation(desc = "上一次领取要塞奖励的时间")
    private int receivedFortressLastTime;

    public long getUserId() {
        return userId;
    }
    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getPhysical() {
        return physical;
    }
    public void setPhysical(int physical) {
        if (this.physical != physical) {
            this.physical = physical;
            setOp(DataStatus.Update);
        }
    }

    public long getPhysicalRefreshTime() {
        return physicalRefreshTime;
    }
    public void setPhysicalRefreshTime(long physicalRefreshTime) {
        if (this.physicalRefreshTime != physicalRefreshTime) {
            this.physicalRefreshTime = physicalRefreshTime;
            setOp(DataStatus.Update);
        }
    }

    public int getOfficeCurPos() {
        return officeCurPos;
    }
    public void setOfficeCurPos(int officeCurPos) {
        if (this.officeCurPos != officeCurPos) {
            this.officeCurPos = officeCurPos;
            setOp(DataStatus.Update);
        }
    }

    public int getOfficeLevel() {
        return officeLevel;
    }
    public void setOfficeLevel(int officeLevel) {
        if (this.officeLevel != officeLevel) {
            this.officeLevel = officeLevel;
            setOp(DataStatus.Update);
        }
    }

    public int getOfficeNo() {
        return officeNo;
    }
    public void setOfficeNo(int officeNo) {
        if (this.officeNo != officeNo) {
            this.officeNo = officeNo;
            setOp(DataStatus.Update);
        }
    }

    public int getOfficeSeatTime() {
        return officeSeatTime;
    }
    public void setOfficeSeatTime(int officeSeatTime) {
        if (this.officeSeatTime != officeSeatTime) {
            this.officeSeatTime = officeSeatTime;
            setOp(DataStatus.Update);
        }
    }

    public int getOfficeRobTimes() {
        return officeRobTimes;
    }
    public void setOfficeRobTimes(int officeRobTimes) {
        if (this.officeRobTimes != officeRobTimes) {
            this.officeRobTimes = officeRobTimes;
            setOp(DataStatus.Update);
        }
    }

    public int getDailyOfficeRefreshTime() {
        return dailyOfficeRefreshTime;
    }
    public void setDailyOfficeRefreshTime(int dailyOfficeRefreshTime) {
        if (this.dailyOfficeRefreshTime != dailyOfficeRefreshTime) {
            this.dailyOfficeRefreshTime = dailyOfficeRefreshTime;
            setOp(DataStatus.Update);
        }
    }

    public int getDailyResGrabRefreshTime() {
        return dailyResGrabRefreshTime;
    }
    public void setDailyResGrabRefreshTime(int dailyResGrabRefreshTime) {
        if (this.dailyResGrabRefreshTime != dailyResGrabRefreshTime) {
            this.dailyResGrabRefreshTime = dailyResGrabRefreshTime;
            setOp(DataStatus.Update);
        }
    }

    public void setOfficeTip(MonopolyMarketOfficeTip officeTip) {
        if (!JSON.toJSONString(this.officeTip).equals(JSON.toJSONString(officeTip))) {
            this.officeTip = officeTip;
            setOp(DataStatus.Update);
        }
    }

    public MonopolyMarketOfficeTip getOfficeTip() {
        return officeTip;
    }

    public boolean getHasTip() {
        return hasTip;
    }
    public void setHasTip(boolean hasTip) {
        if (this.hasTip != hasTip) {
            this.hasTip = hasTip;
            setOp(DataStatus.Update);
        }
    }

    public int getEnterOfficeReportLastTime() {
        return enterOfficeReportLastTime;
    }
    public void setEnterOfficeReportLastTime(int enterOfficeReportLastTime) {
        if (this.enterOfficeReportLastTime != enterOfficeReportLastTime) {
            this.enterOfficeReportLastTime = enterOfficeReportLastTime;
            setOp(DataStatus.Update);
        }
    }

    public int getEnterResGrabReportLastTime() {
        return enterResGrabReportLastTime;
    }
    public void setEnterResGrabReportLastTime(int enterResGrabReportLastTime) {
        if (this.enterResGrabReportLastTime != enterResGrabReportLastTime) {
            this.enterResGrabReportLastTime = enterResGrabReportLastTime;
            setOp(DataStatus.Update);
        }
    }

    public int getTeaLastNum() {
        return teaLastNum;
    }

    public void setTeaLastNum(int teaLastNum) {
        if (this.teaLastNum != teaLastNum) {
            this.teaLastNum = teaLastNum;
            setOp(DataStatus.Update);
        }
    }

    public int getTeaLastGetTime() {
        return teaLastGetTime;
    }

    public void setTeaLastGetTime(int teaLastGetTime) {
        if (this.teaLastGetTime != teaLastGetTime) {
            this.teaLastGetTime = teaLastGetTime;
            setOp(DataStatus.Update);
        }
    }
}
